#include "ccharacter.h"

//---CCharacter

CCharacter::CCharacter(QString clsName,QString displayName)
{
    if(CClass::isValidClass(clsName))
        pClass = new CClass(clsName);
    else
        throw std::invalid_argument(clsName.toStdString()
                                    + " is no valid class.");
    this->displayName = displayName;
}

CCharacter::~CCharacter(){
    delete pClass;
}

CCharacter & CCharacter::operator =(const CCharacter &oc)
{
    pClass = new CClass(*oc.pClass);
    displayName = QString(displayName);
    return *this;
}
